package cn.donting.jme.edit.state;

import com.jme3.input.*;
import com.jme3.input.controls.KeyTrigger;
import com.jme3.input.controls.MouseAxisTrigger;
import com.jme3.input.controls.MouseButtonTrigger;
import com.jme3.math.Vector3f;
import com.jme3.renderer.Camera;

/**
 * 编辑器场景移动 控制
 */
public class EditFlyByCamera extends FlyByCamera {

    public EditFlyByCamera(Camera cam) {
        super(cam);
        setDragToRotate(true);
    }

    @Override
    public void registerWithInput(InputManager inputManager) {
        this.inputManager=inputManager;
        super.registerWithInput(inputManager);
        inputManager.deleteMapping(CameraInput.FLYCAM_ZOOMIN);
        inputManager.deleteMapping(CameraInput.FLYCAM_ZOOMOUT);
        inputManager.deleteMapping(CameraInput.FLYCAM_ROTATEDRAG);
        inputManager.addMapping(CameraInput.FLYCAM_ROTATEDRAG, new MouseButtonTrigger(MouseInput.BUTTON_RIGHT));
        inputManager.addListener(this,CameraInput.FLYCAM_ROTATEDRAG);
    }
}
